import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:share_fit/app/helper/ext/tr_ext.dart';
import 'package:share_fit/app/tools/color_const.dart';
import 'package:share_fit/generated/locales.g.dart';

class AlarmDelDialog extends Dialog {

  Function callback;

  AlarmDelDialog({required this.callback});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        child: Material(
            type: MaterialType.transparency,
            child: Center(
                child: GestureDetector(
                    onTap: () {
                      print('～');
                    },
                    child: Container(
                      width: 916.w,
                      height: 710.w,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(10),
                        color: Colors.white,
                      ),
                      child: Column(
                        children: [
                          SizedBox(height: 94.h,),
                          Image(
                            width: 139.w,
                            height: 149.h,
                            color: ColorConst.accentColor,
                            image: AssetImage("assets/images/device/ic_contacts_del.png"),),
                          Container(
                              margin: EdgeInsets.fromLTRB(42.w, 80.h, 42.w, 0),
                              alignment: Alignment.center,
                              child: Text(LocaleKeys.alarm_del_tips.ts, style: TextStyle(fontSize: 52.sp, color: ColorConst.btnFontColor))
                          ),
                          SizedBox(height: 80.h,),
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceAround,
                            children: [
                              GestureDetector(
                                  behavior: HitTestBehavior.opaque,
                                  child: Container(
                                      width: 383.w,
                                      height: 120.h,
                                      alignment: Alignment.center,
                                      decoration: BoxDecoration(
                                        color: ColorConst.accentColor,
                                        borderRadius: BorderRadius.circular(10),
                                      ),
                                      child: Text(
                                          LocaleKeys.reset_ok.ts,
                                          textAlign: TextAlign.center,
                                          style: TextStyle(color: Colors.white, fontSize: 54.sp, fontWeight: FontWeight.w400)
                                      )
                                  ),
                                  onTap: () {
                                    callback();
                                    Navigator.pop(context);
                                  }),
                              GestureDetector(
                                  behavior: HitTestBehavior.opaque,
                                  child: Container(
                                      width: 383.w,
                                      height: 120.h,
                                      alignment: Alignment.center,
                                      decoration: BoxDecoration(
                                        color: ColorConst.secondaryBgColor,
                                        borderRadius: BorderRadius.circular(10),
                                      ),
                                      child: Text(
                                          LocaleKeys.person_choice_cancel.ts,
                                          textAlign: TextAlign.center,
                                          style: TextStyle(color: Colors.black, fontSize: 54.sp, fontWeight: FontWeight.w400)
                                      )
                                  ),
                                  onTap: () {
                                    Navigator.pop(context);
                                  }),
                            ],)
                        ],),)
                ))),
        onTap: () {
          Navigator.pop(context);
        }
    );
  }
}